package com.sywl.service.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sywl.dao.RoleDao;
import com.sywl.orm.Role;
import com.sywl.service.RoleService;
import com.sywl.util.DataGridModel;

@Service(value="roleService")
@Transactional
public class RoleServiceImpl implements RoleService {

	@Resource(name="roleDao")
	private RoleDao roleDao;
	
	public void save(Role entity) {
		roleDao.save(entity);
	}

	public void update(Role entity) {
		roleDao.update(entity);
	}

	public void delete(Serializable id) {
		roleDao.delete(id);
	}

	public Role findById(Serializable id) {
		return roleDao.findById(id);
	}

	public List<Role> getAll() {
		return roleDao.getAll();
	}

	public List<Role> findByHQL(String hql, Object... params) {
		return roleDao.findByHQL(hql, params);
	}

	public Map<String, Object> getPageList(DataGridModel dgm, Role entity)
			throws Exception {
		// TODO Auto-generated method stub
		return roleDao.getPageList(dgm, entity);
	}
}
